<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set value="${pageContext.request.contextPath }" var="ctx"></c:set>
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="description" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->

    <!-- Title -->
    <title></title>

    <!-- Favicon -->
    <link rel="icon" href="${ctx }/img/core-img/favicon.ico">

    <!-- Stylesheet -->
    <link rel="stylesheet" href="${ctx }/style.css">
	<!-- jQuery-2.2.4 js -->
    <script src="${ctx }/js/jquery/jquery-2.2.4.min.js"></script>
</head>

<body>
<script type="text/javascript">
$(function () {
    var msg = '${msg}';
    if(msg!=""){
        alert(msg)
    }
});

</script>
    <!-- Preloader -->
    <div class="preloader d-flex align-items-center justify-content-center">
        <div class="spinner">
            <div class="bounce1"></div>
            <div class="bounce2"></div>
            <div class="bounce3"></div>
        </div>
    </div>

    <!-- ##### Header Area Start ##### -->
    <header class="header-area">
        <!-- Top Header Area -->
        <div class="top-header-area">
            <div class="container h-100">
                <div class="row h-100 align-items-center">
                    <div class="col-12 d-flex align-items-center justify-content-between">
                        <!-- Logo Area -->
                        <div class="logo">
                            <a href="index.jsp"><img src="${ctx }/img/core-img/logo.png" alt=""></a>
                        </div>

                        <!-- Search & Login Area -->
                        <div class="search-login-area d-flex align-items-center">
                            <!-- Top Search Area -->
                            <div class="top-search-area">
                                <form action="#" method="post">
                                    <input type="search" name="top-search" id="topSearch" placeholder="Search">
                                    <button type="submit" class="btn"><i class="fa fa-search"></i></button>
                                </form>
                            </div>
                            <!-- Login Area -->
                             <div class="login-area">
                                <c:choose>
                                    <c:when test="${user==null}">
                                    <a href="${ctx }/login_register.jsp">
                                        <span>登陆 / 注册</span>
                                    </c:when>
                                    <c:otherwise>
                                        <a href="${ctx }/showUserInfo?id=${user.id}">
                                        <span>Welcome ${user.name}</span>
                                    </c:otherwise>
                                </c:choose>
                                <i class="fa fa-lock" aria-hidden="true"></i></a>
                        </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Navbar Area -->
        <div class="egames-main-menu" id="sticker">
            <div class="classy-nav-container breakpoint-off">
                <div class="container">
                    <!-- Menu -->
                    <nav class="classy-navbar justify-content-between" id="egamesNav">

                    <!-- Navbar Toggler -->
                    <div class="classy-navbar-toggler">
                        <span class="navbarToggler"><span></span><span></span><span></span></span>
                    </div>

                    <!-- Menu -->
                    <div class="classy-menu">

                        <!-- Close Button -->
                        <div class="classycloseIcon">
                            <div class="cross-wrap"><span class="top"></span><span class="bottom"></span></div>
                        </div>

                        <!-- Nav Start -->
                        <div class="classynav">
                            <ul>
                                <li><a href="${ctx }/index.jsp">首页</a></li>
                                <li><a href="${ctx }/user_gameList?pageNum=1">概况</a>
                                    <ul class="dropdown">
                                        <li><a href="${ctx}/user_gameList?pageNum=1">游戏浏览</a></li>
                                        <li><a href="#">游戏独览</a></li>
                                    </ul>
                                </li>
                                <li><a href="#">页面</a>
                                    <ul class="dropdown">
                                        <li><a href="${ctx }/index.jsp">首页</a></li>
                                        <li><a href="${ctx }/post.jsp">全部文章</a></li>
                                        <li><a href="${ctx }/single-post.jsp">单篇文章</a></li>
                                        <li><a href="${ctx}/user_gameList?pageNum=1">游戏浏览</a></li>
                                        <li><a href="#">游戏独览</a></li>
                                        <li><a href="${ctx }/contact.jsp">联系我们</a></li>
                                    </ul>
                                </li>
                                <li><a href="post.jsp">文章</a>
                                    <ul class="dropdown">
                                        <li><a href="post.jsp">全部文章</a></li>
                                        <li><a href="single-post.jsp">单篇文章</a></li>
                                    </ul>
                                </li>
                                <li><a href="#">概况</a>
                                    <ul class="dropdown">
                                        <li><a href="${ctx}/user_gameList?pageNum=1">游戏预览</a></li>
                                        <li><a href="#">游戏独览</a></li>
                                    </ul>
                                </li>
                                <li><a href="contact.jsp">联系我们</a></li>
                                <li><a href="${ctx}/items?uid=${user.id }">我的购物车</a>
                                <li><a href="${ctx}/showLibrary?uid=${user.id }">我的库</a>
                            </ul>
                        </div>
                        <!-- Nav End -->
                    </div>

                    <!-- Top Social Info -->
                    <div class="top-social-info">
                        <a href="#" data-toggle="tooltip" data-placement="top" title="Pinterest"><i
                                class="fa fa-pinterest" aria-hidden="true"></i></a>
                        <a href="#" data-toggle="tooltip" data-placement="top" title="Facebook"><i
                                class="fa fa-facebook" aria-hidden="true"></i></a>
                        <a href="#" data-toggle="tooltip" data-placement="top" title="Twitter"><i class="fa fa-twitter"
                                                                                                  aria-hidden="true"></i></a>
                        <a href="#" data-toggle="tooltip" data-placement="top" title="Dribbble"><i
                                class="fa fa-dribbble" aria-hidden="true"></i></a>
                        <a href="#" data-toggle="tooltip" data-placement="top" title="Behance"><i class="fa fa-behance"
                                                                                                  aria-hidden="true"></i></a>
                        <a href="#" data-toggle="tooltip" data-placement="top" title="Linkedin"><i
                                class="fa fa-linkedin" aria-hidden="true"></i></a>
                    </div>
                </nav>
                </div>
            </div>
        </div>
    </header>
    <!-- ##### Header Area End ##### -->

    <!-- ##### Breadcrumb Area Start ##### -->
    <div class="breadcrumb-area bg-img bg-overlay" style="background-image: url(${ctx }/img/bg-img/27.jpg);">
        <div class="container h-100">
            <div class="row h-100 align-items-center">
                <!-- Breadcrumb Text -->
                <div class="col-12">
                    <div class="breadcrumb-text">
                        <h2>UserCart</h2>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- ##### Breadcrumb Area End ##### -->

    <!-- ##### Game Review Area Start ##### -->
    <section class="game-review-area section-padding-100">
        <div class="container">
            <div class="row">
                <div class="col-12">
                	
                    <!-- *** Single Review Area *** -->
                    <c:forEach items="${cart}" var="c">
                    	<div class="single-game-review-area d-flex flex-wrap mb-30 wow fadeInUp" data-wow-delay="300ms">
	                        <div class="game-thumbnail">
	                            <img src="${ctx}/img/gameImg/${c.value.game.img}" alt="${c.value.game.img}">
	                        </div>
	                        <div class="game-content ">	               
	                            <span class="game-tag">${c.value.game.tag}<a href="${ctx }/delCartItem?uid=${user.id}&gid=${c.value.game.id}" class="btn btn-link">移除</a></span>
	                            <a href="${ctx }/game_detail?id=${c.value.game.id}" class="game-title">${c.value.game.name}</a>
	                            <div class="game-meta">
	                                <a href="#" class="game-date">开发商：${c.value.game.developer}</a>
	                            </div>
	                            <p>${c.value.game.description}</p>
	                            <!-- Download & Rating Area -->
	                            <div class="download-rating-area d-flex align-items-center justify-content-between">
	                                <div class="download-area">
	                                    <a href="#">原价：${c.value.game.price}</a>
	                                    <a href="#" style="color: red">折后价：${c.value.game.discountprice}</a>	                        
	                                </div>
	                                <div class="rating-area text-center">
	                                <c:if test="${c.value.account }">
	                                    <h3><a href="${ctx }/singleAccount?uid=${user.id}&gid=${c.value.game.id}" class="text-info">单个结算</a></h3>
	                                </c:if>
	                                </div>
	                            </div>
	                        </div>
	                    </div>

					</c:forEach>
                    <!-- *** Single Review Area *** -->
                    
                    
                    <c:if test="${!empty cart}">
                  	<div class="single-game-review-area d-flex flex-wrap mb-30">
                        <div class="game-thumbnail">
                            <img src="${ctx}/img/gameImg/" alt="">
                        </div>
                        <div class="game-content">
                            <span class="game-tag"></span>
                            <a href="" class="game-title"></a>
                            <div class="game-meta">
                                <a href="#" class="game-date"></a>
                            </div>
                            <p></p>
                            <!-- Download & Rating Area -->
                            <div class="download-rating-area d-flex align-items-center justify-content-between">
                                <div class="download-area">
                                 	<a href="${ctx }/clearCartItem?uid=${user.id}">清空购物车</a>
                                    <a href="#" style="color: red">总价：${totalPrice}</a>
                                </div>
                                <div class="rating-area text-center">
                                    <h3><a href="${ctx }/allAccount?uid=${user.id}" class="text-info">结算</a></h3>
                                </div>
                            </div>
                        </div>
                    </div>
                    </c:if>
                    
		
                    <!-- *** Single Review Area *** -->
                   

                    <!-- *** Single Review Area *** -->
                    

                    <!-- *** Single Review Area *** -->
                   

                    <!-- ### Pagination Area ### -->
                 
	                
	            </div>
	        </div>
        </div>
    </section>
    <!-- ##### Game Review Area End ##### -->

    <!-- ##### Footer Area Start ##### -->
    <footer class="footer-area">
        <!-- Main Footer Area -->
        <div class="main-footer-area section-padding-100-0">
            <div class="container">
                <div class="row">
                    <!-- Single Footer Widget -->
                    <div class="col-12 col-sm-6 col-lg-3">
                        <div class="single-footer-widget mb-70">
                            <div class="widget-title">
                                <a href="index.html"><img src="img/core-img/logo2.png" alt=""></a>
                            </div>
                            <div class="widget-content">
                                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris velit arcu, scelerisque dignissim massa quis, mattis facilisis erat. Aliquam erat volutpat. Sed efficitur diam ut interdum ultricies.</p>
                            </div>
                        </div>
                    </div>

                    <!-- Single Footer Widget -->
                    <div class="col-12 col-sm-6 col-lg-3">
                        <div class="single-footer-widget mb-70">
                            <div class="widget-title">
                                <h4>Game Reviews</h4>
                            </div>
                            <div class="widget-content">
                                <nav>
                                    <ul>
                                        <li><a href="#">Doom</a></li>
                                        <li><a href="#">Grand Theft Auto</a></li>
                                        <li><a href="#">Bloodborne</a></li>
                                        <li><a href="#">God of war</a></li>
                                        <li><a href="#">Persona 5</a></li>
                                    </ul>
                                </nav>
                            </div>
                        </div>
                    </div>

                    <!-- Single Footer Widget -->
                    <div class="col-12 col-sm-6 col-lg-3">
                        <div class="single-footer-widget mb-70">
                            <div class="widget-title">
                                <h4>Usefull Links</h4>
                            </div>
                            <div class="widget-content">
                                <nav>
                                    <ul>
                                        <li><a href="#">Testimanials</a></li>
                                        <li><a href="#">Reviews</a></li>
                                        <li><a href="#">New Games</a></li>
                                        <li><a href="#">Forum</a></li>
                                        <li><a href="#">Contact</a></li>
                                    </ul>
                                </nav>
                            </div>
                        </div>
                    </div>

                    <!-- Single Footer Widget -->
                    <div class="col-12 col-sm-6 col-lg-3">
                        <div class="single-footer-widget mb-70">
                            <div class="widget-title">
                                <h4>What’s new</h4>
                            </div>
                            <div class="widget-content">
                                <nav>
                                    <ul>
                                        <li><a href="#">Doom</a></li>
                                        <li><a href="#">Grand Theft Auto</a></li>
                                        <li><a href="#">Bloodborne</a></li>
                                        <li><a href="#">God of war</a></li>
                                        <li><a href="#">Persona 5</a></li>
                                    </ul>
                                </nav>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Copywrite Area -->
        <div class="copywrite-content">
            <div class="container h-100">
                <div class="row h-100 align-items-center">
                    <div class="col-12 col-sm-5">
                        <!-- Copywrite Text -->
                        <p class="copywrite-text"><a href="#">
Copyright &copy; 2018.Company name All rights reserved.</a>

</p>
                    </div>
                    <div class="col-12 col-sm-7">
                        <!-- Footer Nav -->
                        <div class="footer-nav">
                            <ul>
                                <li><a href="index.html">Home</a></li>
                                <li><a href="game-review.html">Games</a></li>
                                <li><a href="post.html">Articles</a></li>
                                <li><a href="single-game-review.html">Reviews</a></li>
                                <li><a href="contact.html">Contact</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </footer>
    <!-- ##### Footer Area End ##### -->

    <!-- ##### All Javascript Script ##### -->
    
    <!-- Popper js -->
    <script src="${ctx }/js/bootstrap/popper.min.js"></script>
    <!-- Bootstrap js -->
    <script src="${ctx }/js/bootstrap/bootstrap.min.js"></script>
    <!-- All Plugins js -->
    <script src="${ctx }/js/plugins/plugins.js"></script>
    <!-- Active js -->
    <script src="${ctx }/js/active.js"></script>
</body>

</html>